﻿using Autofac;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore.Internal;
using NewCodeAPI.IServices;
using NewCodeAPI.Service;
using Service;

namespace NewCodeAPI.Common
{
    public class AutofacModuleRegister : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType<UserService>().As<IUserService>();
            builder.RegisterType<HttpContextAccessor>().As<IHttpContextAccessor>();
            builder.RegisterType<EncryptionService>().As<EncryptionService>();
            builder.RegisterType<RegistrationService>().As<RegistrationService>();
            builder.RegisterType<UserLoginService>().As<UserLoginService>();
            builder.RegisterType<OpenclassService>().As<IOpenclassService>();
            builder.RegisterType<BaseService>().As<IBaseService>();
        }
    }
}
